<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>兴趣群组 - 友趣社交</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <style>
        :root {
            --primary: #4361ee;
            --primary-light: #7209b7;
            --secondary: #3f37c9;
            --accent: #4895ef;
            --light: #f8f9fa;
            --dark: #212529;
            --gray: #6c757d;
            --light-gray: #e9ecef;
            --success: #38b000;
            --danger: #e63946;
            --warning: #ffb703;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: #f5f7fa;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            background-color: white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            padding: 0.8rem 1rem;
        }
        
        .navbar-brand {
            color: var(--primary);
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 1.4rem;
        }
        
        .nav-link {
            color: var(--dark);
            font-weight: 500;
            margin: 0 5px;
            transition: var(--transition);
        }
        
        .nav-link:hover, .nav-link.active {
            color: var(--primary);
        }
        
        /* 页面标题区域 */
        .page-header {
            padding: 2rem 0;
            background-color: white;
            margin-bottom: 2rem;
        }
        
        .page-title {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        
        .page-description {
            color: var(--gray);
            max-width: 800px;
        }
        
        /* 筛选区域 */
        .filter-container {
            background-color: white;
            border-radius: 12px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .filter-section {
            margin-bottom: 1.5rem;
        }
        
        .filter-title {
            font-weight: 600;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .search-box {
            position: relative;
        }
        
        .search-box input {
            padding-left: 2.5rem;
            border-radius: 8px;
            border-color: var(--light-gray);
        }
        
        .search-icon {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
        }
        
        .category-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
        }
        
        .category-tag {
            background-color: var(--light);
            color: var(--dark);
            padding: 0.35rem 1rem;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: var(--transition);
            border: 1px solid transparent;
        }
        
        .category-tag:hover {
            background-color: rgba(67, 97, 238, 0.1);
            color: var(--primary);
        }
        
        .category-tag.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            align-items: center;
        }
        
        .form-select {
            border-radius: 8px;
            border-color: var(--light-gray);
            padding: 0.375rem 1.75rem 0.375rem 0.75rem;
        }
        
        .view-toggle {
            display: flex;
            border: 1px solid var(--light-gray);
            border-radius: 8px;
            overflow: hidden;
        }
        
        .view-btn {
            background-color: white;
            border: none;
            padding: 0.375rem 0.75rem;
            color: var(--gray);
            transition: var(--transition);
        }
        
        .view-btn.active {
            background-color: var(--primary);
            color: white;
        }
        
        .view-btn:hover:not(.active) {
            background-color: var(--light);
        }
        
        /* 群组列表 */
        .group-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .group-card {
            background-color: white;
            border-radius: 12px;
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        
        .group-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        
        .group-image {
            height: 160px;
            overflow: hidden;
            position: relative;
        }
        
        .group-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--transition);
        }
        
        .group-card:hover .group-image img {
            transform: scale(1.05);
        }
        
        .group-category {
            position: absolute;
            top: 1rem;
            left: 1rem;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            font-size: 0.8rem;
        }
        
        .group-body {
            padding: 1.25rem;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .group-title {
            font-size: 1.15rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            transition: var(--transition);
        }
        
        .group-card:hover .group-title {
            color: var(--primary);
        }
        
        .group-description {
            color: var(--gray);
            font-size: 0.9rem;
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            flex: 1;
        }
        
        .group-meta {
            display: flex;
            justify-content: space-between;
            color: var(--gray);
            font-size: 0.85rem;
            margin-bottom: 1rem;
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .group-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .group-founder {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
        }
        
        .founder-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .join-btn {
            background-color: transparent;
            border: 1px solid var(--primary);
            color: var(--primary);
            border-radius: 6px;
            padding: 0.25rem 0.75rem;
            font-size: 0.85rem;
            transition: var(--transition);
        }
        
        .join-btn:hover, .join-btn.joined {
            background-color: var(--primary);
            color: white;
        }
        
        /* 列表视图样式 */
        .list-view .group-list {
            grid-template-columns: 1fr;
        }
        
        .list-view .group-card {
            flex-direction: row;
        }
        
        .list-view .group-image {
            width: 200px;
            height: auto;
            flex: 0 0 200px;
        }
        
        .list-view .group-body {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .list-view .group-description {
            -webkit-line-clamp: 2;
        }
        
        /* 分页样式 */
        .pagination-container {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        .pagination {
            --bs-pagination-color: var(--primary);
            --bs-pagination-active-bg: var(--primary);
            --bs-pagination-active-border-color: var(--primary);
            --bs-pagination-hover-color: var(--secondary);
        }
        
        /* 页脚样式 */
        footer {
            background-color: var(--dark);
            color: white;
            padding: 3rem 0 2rem;
            margin-top: 5rem;
        }
        
        .footer-col {
            margin-bottom: 2rem;
        }
        
        .footer-title {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 1rem;
        }
        
        .footer-links {
            list-style: none;
            padding: 0;
        }
        
        .footer-links li {
            margin-bottom: 0.5rem;
        }
        
        .footer-links a {
            color: var(--light-gray);
            text-decoration: none;
            transition: var(--transition);
        }
        
        .footer-links a:hover {
            color: white;
        }
        
        .copyright {
            text-align: center;
            padding-top: 2rem;
            margin-top: 2rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--light-gray);
            font-size: 0.9rem;
        }
        
        @media (max-width: 768px) {
            .page-title {
                font-size: 1.5rem;
            }
            
            .filter-options {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .form-select {
                width: 100%;
            }
            
            .list-view .group-card {
                flex-direction: column;
            }
            
            .list-view .group-image {
                width: 100%;
                height: 160px;
                flex: none;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg">
        <div class="container">
            <a class="navbar-brand" href="#">
                <i class="fas fa-users"></i>
                <span>友趣</span>
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">人际关系</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="#">兴趣小组</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">活动中心</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">消息</a>
                    </li>
                </ul>
                
                <div class="d-flex align-items-center gap-3">
                    <div class="dropdown">
                        <button class="btn btn-secondary dropdown-toggle rounded-circle" type="button" data-bs-toggle="dropdown">
                            <img src="https://picsum.photos/id/64/40/40" alt="用户头像" width="36" height="36" class="rounded-circle">
                        </button>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="#">个人主页</a></li>
                            <li><a class="dropdown-item" href="#">我的群组</a></li>
                            <li><a class="dropdown-item" href="#">设置</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="#">退出登录</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <!-- 页面标题 -->
    <div class="page-header">
        <div class="container">
            <h1 class="page-title">探索兴趣群组</h1>
            <p class="page-description">加入志同道合的群组，结交新朋友，分享共同兴趣。这里有超过10,000个活跃群组等待你的发现。</p>
        </div>
    </div>

    <!-- 主要内容 -->
    <div class="container">
        <!-- 筛选区域 -->
        <div class="filter-container">
            <!-- 搜索框 -->
            <div class="filter-section">
                <div class="search-box">
                    <i class="fas fa-search search-icon"></i>
                    <input type="text" class="form-control" placeholder="搜索群组名称或关键词...">
                </div>
            </div>
            
            <!-- 分类筛选 -->
            <div class="filter-section">
                <h3 class="filter-title"><i class="fas fa-th-large"></i> 群组分类</h3>
                <div class="category-tags">
                    <div class="category-tag active">全部群组</div>
                    <div class="category-tag">电影</div>
                    <div class="category-tag">音乐</div>
                    <div class="category-tag">读书</div>
                    <div class="category-tag">旅行</div>
                    <div class="category-tag">美食</div>
                    <div class="category-tag">运动</div>
                    <div class="category-tag">摄影</div>
                    <div class="category-tag">艺术</div>
                    <div class="category-tag">科技</div>
                    <div class="category-tag">游戏</div>
                    <div class="category-tag">更多 <i class="fas fa-chevron-down"></i></div>
                </div>
            </div>
            
            <!-- 筛选选项和排序 -->
            <div class="filter-section">
                <div class="filter-options">
                    <div class="me-3">
                        <label for="sort-select" class="form-label me-2">排序方式:</label>
                        <select class="form-select" id="sort-select">
                            <option value="recommended">推荐群组</option>
                            <option value="popular">最受欢迎</option>
                            <option value="recent">最新创建</option>
                            <option value="active">最近活跃</option>
                        </select>
                    </div>
                    
                    <div class="me-3">
                        <label for="member-count" class="form-label me-2">成员数量:</label>
                        <select class="form-select" id="member-count">
                            <option value="all">全部</option>
                            <option value="0-100">100人以下</option>
                            <option value="100-500">100-500人</option>
                            <option value="500-1000">500-1000人</option>
                            <option value="1000+">1000人以上</option>
                        </select>
                    </div>
                    
                    <div class="me-3">
                        <label for="activity-level" class="form-label me-2">活跃度:</label>
                        <select class="form-select" id="activity-level">
                            <option value="all">全部</option>
                            <option value="high">高</option>
                            <option value="medium">中</option>
                            <option value="low">低</option>
                        </select>
                    </div>
                    
                    <div class="ms-auto">
                        <label class="form-label me-2">视图:</label>
                        <div class="view-toggle">
                            <button class="view-btn active" data-view="grid"><i class="fas fa-th"></i></button>
                            <button class="view-btn" data-view="list"><i class="fas fa-list"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 群组列表 -->
        <div class="group-list-container">
            <div class="d-flex justify-content-between align-items-center mb-3">
                <h2 class="h5 mb-0">为你推荐的群组 <span class="text-muted" style="font-weight: normal;">(共248个)</span></h2>
                <div>
                    <button class="btn btn-sm btn-outline-primary">
                        <i class="fas fa-plus"></i> 创建群组
                    </button>
                </div>
            </div>
            
            <div class="group-list">
                <!-- 群组1 -->
                <div class="group-card">
                    <div class="group-image">
                        <img src="https://picsum.photos/id/1068/600/400" alt="独立电影鉴赏群组封面">
                        <div class="group-category">电影</div>
                    </div>
                    <div class="group-body">
                        <h3 class="group-title">独立电影鉴赏</h3>
                        <p class="group-description">
                            探讨独立电影的艺术价值，分享小众佳片，组织线下观影活动，与同好交流观影感受。
                        </p>
                        <div class="group-meta">
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>1,872人</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>今日128</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-calendar-alt"></i>
                                <span>2022-05</span>
                            </div>
                        </div>
                        <div class="group-footer">
                            <div class="group-founder">
                                <img src="https://picsum.photos/id/1027/100/100" alt="张小艺" class="founder-avatar">
                                <span>张小艺</span>
                            </div>
                            <button class="join-btn">加入</button>
                        </div>
                    </div>
                </div>
                
                <!-- 群组2 -->
                <div class="group-card">
                    <div class="group-image">
                        <img src="https://picsum.photos/id/1069/600/400" alt="爵士乐爱好者群组封面">
                        <div class="group-category">音乐</div>
                    </div>
                    <div class="group-body">
                        <h3 class="group-title">爵士乐爱好者</h3>
                        <p class="group-description">
                            分享经典与现代爵士乐，讨论爵士乐历史与风格，组织小型现场演出与欣赏活动。
                        </p>
                        <div class="group-meta">
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>3,451人</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>今日87</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-calendar-alt"></i>
                                <span>2021-11</span>
                            </div>
                        </div>
                        <div class="group-footer">
                            <div class="group-founder">
                                <img src="https://picsum.photos/id/1074/100/100" alt="王音乐" class="founder-avatar">
                                <span>王音乐</span>
                            </div>
                            <button class="join-btn">加入</button>
                        </div>
                    </div>
                </div>
                
                <!-- 群组3 -->
                <div class="group-card">
                    <div class="group-image">
                        <img src="https://picsum.photos/id/24/600/400" alt="科幻文学读书会群组封面">
                        <div class="group-category">读书</div>
                    </div>
                    <div class="group-body">
                        <h3 class="group-title">科幻文学读书会</h3>
                        <p class="group-description">
                            专注于科幻小说的阅读与讨论，每月精选一部经典或新锐科幻作品进行深度解析。
                        </p>
                        <div class="group-meta">
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>987人</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>今日42</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-calendar-alt"></i>
                                <span>2023-01</span>
                            </div>
                        </div>
                        <div class="group-footer">
                            <div class="group-founder">
                                <img src="https://picsum.photos/id/1062/100/100" alt="刘科幻" class="founder-avatar">
                                <span>刘科幻</span>
                            </div>
                            <button class="join-btn">加入</button>
                        </div>
                    </div>
                </div>
                
                <!-- 群组4 -->
                <div class="group-card">
                    <div class="group-image">
                        <img src="https://picsum.photos/id/1036/600/400" alt="徒步旅行者群组封面">
                        <div class="group-category">旅行</div>
                    </div>
                    <div class="group-body">
                        <h3 class="group-title">徒步旅行者</h3>
                        <p class="group-description">
                            分享徒步路线与经验，组织周末短途徒步活动，探讨户外装备与安全知识。
                        </p>
                        <div class="group-meta">
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>5,621人</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>今日215</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-calendar-alt"></i>
                                <span>2020-08</span>
                            </div>
                        </div>
                        <div class="group-footer">
                            <div class="group-founder">
                                <img src="https://picsum.photos/id/1066/100/100" alt="张大山" class="founder-avatar">
                                <span>张大山</span>
                            </div>
                            <button class="join-btn joined">已加入</button>
                        </div>
                    </div>
                </div>
                
                <!-- 群组5 -->
                <div class="group-card">
                    <div class="group-image">
                        <img src="https://picsum.photos/id/292/600/400" alt="家常菜分享群组封面">
                        <div class="group-category">美食</div>
                    </div>
                    <div class="group-body">
                        <h3 class="group-title">家常菜分享</h3>
                        <p class="group-description">
                            分享家常菜谱与烹饪技巧，交流食材选购经验，举办线上厨艺比拼活动。
                        </p>
                        <div class="group-meta">
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>4,218人</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>今日156</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-calendar-alt"></i>
                                <span>2021-03</span>
                            </div>
                        </div>
                        <div class="group-footer">
                            <div class="group-founder">
                                <img src="https://picsum.photos/id/1076/100/100" alt="李厨师" class="founder-avatar">
                                <span>李厨师</span>
                            </div>
                            <button class="join-btn">加入</button>
                        </div>
                    </div>
                </div>
                
                <!-- 群组6 -->
                <div class="group-card">
                    <div class="group-image">
                        <img src="https://picsum.photos/id/1058/600/400" alt="城市骑行俱乐部群组封面">
                        <div class="group-category">运动</div>
                    </div>
                    <div class="group-body">
                        <h3 class="group-title">城市骑行俱乐部</h3>
                        <p class="group-description">
                            组织城市及周边骑行活动，分享骑行路线与装备心得，推广绿色出行理念。
                        </p>
                        <div class="group-meta">
                            <div class="meta-item">
                                <i class="fas fa-users"></i>
                                <span>2,154人</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>今日67</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-calendar-alt"></i>
                                <span>2022-09</span>
                            </div>
                        </div>
                        <div class="group-footer">
                            <div class="group-founder">
                                <img src="https://picsum.photos/id/1059/100/100" alt="赵骑行" class="founder-avatar">
                                <span>赵骑行</span>
                            </div>
                            <button class="join-btn">加入</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 分页 -->
            <div class="pagination-container">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li class="page-item disabled">
                            <a class="page-link" href="#" tabindex="-1" aria-disabled="true">上一页</a>
                        </li>
                        <li class="page-item active"><a class="page-link" href="#">1</a></li>
                        <li class="page-item"><a class="page-link" href="#">2</a></li>
                        <li class="page-item"><a class="page-link" href="#">3</a></li>
                        <li class="page-item"><a class="page-link" href="#">4</a></li>
                        <li class="page-item"><a class="page-link" href="#">5</a></li>
                        <li class="page-item">
                            <a class="page-link" href="#">下一页</a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="row">
                <div class="col-md-4 footer-col">
                    <h3 class="footer-title">友趣</h3>
                    <p>友趣是一个基于兴趣的社交平台，帮助你找到志同道合的朋友，一起分享快乐，探索世界。</p>
                </div>
                
                <div class="col-md-2 footer-col">
                    <h3 class="footer-title">平台功能</h3>
                    <ul class="footer-links">
                        <li><a href="#">交友推荐</a></li>
                        <li><a href="#">兴趣小组</a></li>
                        <li><a href="#">活动中心</a></li>
                        <li><a href="#">兴趣测试</a></li>
                        <li><a href="#">话题讨论</a></li>
                    </ul>
                </div>
                
                <div class="col-md-2 footer-col">
                    <h3 class="footer-title">关于我们</h3>
                    <ul class="footer-links">
                        <li><a href="#">平台介绍</a></li>
                        <li><a href="#">团队成员</a></li>
                        <li><a href="#">加入我们</a></li>
                        <li><a href="#">联系方式</a></li>
                        <li><a href="#">用户反馈</a></li>
                    </ul>
                </div>
                
                <div class="col-md-4 footer-col">
                    <h3 class="footer-title">联系我们</h3>
                    <ul class="footer-links">
                        <li><i class="fas fa-envelope me-2"></i> contact@youqu.com</li>
                        <li><i class="fas fa-phone me-2"></i> 400-123-4567</li>
                        <li><i class="fas fa-map-marker-alt me-2"></i> 北京市朝阳区创意园区A座501</li>
                    </ul>
                </div>
            </div>
            
            <div class="copyright">
                &copy; 2023 友趣社交平台 版权所有 | 京ICP备12345678号
            </div>
        </div>
    </footer>

    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 分类标签选择
        document.querySelectorAll('.category-tag').forEach(tag => {
            tag.addEventListener('click', function() {
                // 移除所有标签的active类
                document.querySelectorAll('.category-tag').forEach(t => {
                    t.classList.remove('active');
                });
                // 给当前点击的标签添加active类
                this.classList.add('active');
                
                // 这里可以添加筛选逻辑
                filterGroups();
            });
        });
        
        // 视图切换
        document.querySelectorAll('.view-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 移除所有按钮的active类
                document.querySelectorAll('.view-btn').forEach(b => {
                    b.classList.remove('active');
                });
                // 给当前点击的按钮添加active类
                this.classList.add('active');
                
                // 切换视图
                const viewType = this.getAttribute('data-view');
                const container = document.querySelector('.group-list-container');
                
                if (viewType === 'list') {
                    container.classList.add('list-view');
                } else {
                    container.classList.remove('list-view');
                }
            });
        });
        
        // 排序和筛选条件变化时触发筛选
        document.getElementById('sort-select').addEventListener('change', filterGroups);
        document.getElementById('member-count').addEventListener('change', filterGroups);
        document.getElementById('activity-level').addEventListener('change', filterGroups);
        
        // 搜索框输入事件
        document.querySelector('.search-box input').addEventListener('input', function() {
            // 延迟搜索，避免频繁触发
            clearTimeout(this.searchTimeout);
            this.searchTimeout = setTimeout(filterGroups, 300);
        });
        
        // 加入群组按钮交互
        document.querySelectorAll('.join-btn').forEach(button => {
            button.addEventListener('click', function() {
                if (this.classList.contains('joined')) {
                    this.textContent = '加入';
                    this.classList.remove('joined');
                } else {
                    this.textContent = '已加入';
                    this.classList.add('joined');
                }
            });
        });
        
        // 筛选群组的函数
        function filterGroups() {
            // 获取当前筛选条件
            const activeCategory = document.querySelector('.category-tag.active').textContent;
            const sortBy = document.getElementById('sort-select').value;
            const memberCount = document.getElementById('member-count').value;
            const activityLevel = document.getElementById('activity-level').value;
            const searchTerm = document.querySelector('.search-box input').value.toLowerCase();
            
            // 这里可以根据筛选条件进行实际的筛选逻辑
            console.log('筛选条件:', {
                category: activeCategory,
                sortBy: sortBy,
                memberCount: memberCount,
                activityLevel: activityLevel,
                searchTerm: searchTerm
            });
            
            // 模拟加载效果
            const groupList = document.querySelector('.group-list');
            groupList.style.opacity = '0.5';
            
            setTimeout(() => {
                groupList.style.opacity = '1';
                // 实际项目中这里会根据筛选条件更新群组列表
            }, 500);
        }
    </script>
</body>
</html>

